package cn.edu.dzkd.software.mapper;

import cn.edu.dzkd.software.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserMapper {

    List<User> selectUsers(@Param("index") int index,
                           @Param("userName") String userName,
                           @Param("roleName") String roleName,
                           @Param("departmentName") String departmentName );

    int selectUserCounts(@Param("userName") String userName,
                         @Param("roleName") String roleName,
                         @Param("departmentName") String departmentName );

    void update(User user);

    User selectUserById(String id);

    void deleteById(String id);

    void insertUser(@Param("username") String username,
                    @Param("password") String password);

    void insertUser02(Map map);  // map{"username":"dzkd001", "password":"123456"}

    void insertUserJSON(@Param("user") User user);

    void updateById(@Param("user") User user);

    User login(String username);
}
